<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/


Route::group(['namespace'=>'App\Http\Controllers\Api\Shop','middleware'=>'WebAuth'],function(){

    Route::post('api/shop/generate_order','OrderController@generate_order');    //下单
    Route::post('api/shop/pay','OrderController@pay');    //重新发起支付
    Route::post('api/shop/calc_order_amount','OrderController@CalcGoodsAmount');  //计算商品总价
    Route::post('api/shop/order_list','OrderController@order_list');  //获取订单列表
    Route::post('api/shop/order_detail','OrderController@orderDetail');  //订单详情

    Route::post('api/shop/goods_list','ProductsController@goodsList');          //商品列表
    Route::post('api/shop/goods_detail','ProductsController@goods_detail');     //商品详情
    Route::post('api/shop/add_to_cart','ProductsController@addToCart');         //添加商品到购物车
    Route::post('api/shop/remove_from_cart','ProductsController@removeFromCart');
    Route::post('api/shop/confirm_obtain_goods','OrderController@confirm_obtain_goods');         //获取购物车列表

    Route::post('api/shop/cart_list','ProductsController@getCartList');         //获取购物车列表
    Route::post('api/shop/get_categories','ProductsController@getCategories');         //获取购物车列表
    Route::post('api/shop/cart_goods_num','ProductsController@getCartGoodsNum');         //获取购物车列表

    Route::post('api/shop/muti_delete','ProductsController@mutiDeleteCarts');         //获取购物车列表

});

Route::group(['namespace'=>'App\Http\Controllers\Api\Shop'],function(){
    Route::post('api/shop/wechat_callback','WechatPayController@wechat_callback'); //微信支付回调
    Route::post('api/alipay_callback','AliPayController@alipay_callback'); //微信支付回调

});
